//
//  DefualCollectionViewCell.m
//  BlocksKit
//
//  Created by admin on 2020/4/15.
//

#import "DefualCollectionViewCell.h"

@implementation DefualCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{
    if (self == [super initWithFrame:frame]) {
        [self confitUI];
    }
    return self;
}

-(void)confitUI{
    [self addSubview:self.titleLab];
    [self addSubview:self.imageView];
     [self addSubview:self.button];
}
-(UILabel *)titleLab{
    if (!_titleLab) {
        _titleLab = [UILabel new];
        _titleLab.font = FONT_SYS10;
        _titleLab.textAlignment = NSTextAlignmentCenter;
    }
    return _titleLab;
}
-(UIImageView *)imageView{
    if (!_imageView) {
        _imageView = [UIImageView new];
    }
    return _imageView;
}
-(UGAlignmentButton *)button{
    if (!_button) {
        _button = [UGAlignmentButton new];
        _button.ug_Alignment = UGAlignmentBottom;
        _button.ug_pand = KPAND_MID;
        [_button setTitleColor:COLORINFO forState:UIControlStateNormal];
        _button.titleLabel.font = FONT_SYS12;
        _button.userInteractionEnabled = NO;
    }
    return _button;
}

-(void)layoutSubviews{
    [super layoutSubviews];
    [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self);
        make.left.mas_equalTo(self);
        make.right.mas_equalTo(self);
    }];
    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self);
        make.left.mas_equalTo(self);
        make.right.mas_equalTo(self);
    }];
    [_button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self);
    }];
}

@end
